<template>
  <ul class="container">
    <li v-for="(item, i) in searchTag" :key="i" class="item">
      <div class="info-box">
        <!-- 图片 -->
        <img v-lazy="item.result_model.tag.icon" />
        <div class="info">
          <!-- 标签名 -->
          <div class="tag-name">{{ item.result_model.tag.tag_name }}</div>
          <!-- 相关数量 -->
          <div class="count">
            <span>{{ item.result_model.tag.concern_user_count }} 关注</span>
            <span>{{ item.result_model.tag.post_article_count }} 文章</span>
          </div>
        </div>
      </div>
      <!-- 关注按钮 -->

      <button class="btn">关注</button>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    searchTag: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  mounted() {
    console.log(this.searchTag)
  },
  created() {},
  methods: {}
}
</script>

<style lang="less" scoped>
.container {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;

  .item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(178, 186, 194, 0.15);

    .info-box {
      display: flex;
      img {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        margin-right: 1.5rem;
        cursor: pointer;
      }

      .tag-name {
        font-size: 1.23rem;
        font-weight: 600;
        color: #2e3135;
        margin-bottom: 0.5rem;
      }

      .count > span {
        margin-right: 1rem;
        position: relative;
        font-size: 1.17rem;
        color: #2e3135;
        white-space: nowrap;
      }

      .count > span:not(:last-child)::after {
        content: ' ';
        width: 2px;
        height: 2px;
        position: absolute;
        background-color: #4e5969;
        border-radius: 50%;
        margin-left: 6px;
        top: 8px;
      }
    }

    .btn {
      font-size: 13px;
      border: 1px solid #6cbd45;
      color: #6cbd45;
      background-color: #fff;
      padding: 0;
      width: 6.17rem;
      height: 2.5rem;
      cursor: pointer;
    }
  }

  .item:hover {
    background-color: rgba(242, 242, 242, 0.4);
  }
}
</style>
